<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        .container{
            width: 300px;
            height: 300px;

            border: 2px solid black;
        }

        .box{
            float: left;
            width: 100px;
            height: 100px;
        }

        .box1{
            background-color: green;
        }
        .box2{
            background-color: yellow;
        }
        .box3{
            background-color: red;
        }

        img{
            width: 200px;
            /* 浮动后解决了空隙问题 */
            float: left;
        }
    </style>
</head>

<body>

    <div class="container">
        <!-- 容器宽度不足横向摆放时会换行 -->
        <div class="box1 box"></div>
        <div class="box2 box"></div>
        <div class="box3 box"></div>
        <div class="box3 box"></div>
    </div>

    <img src="../../文档流问题/小日女.png" alt="">
    <img src="../../文档流问题/小日女.png" alt="">

</body>

</html>